package com.qk.management.web.config;

import com.qk.management.web.interceptor.LoginCheckInterceptor;
import com.qk.management.web.interceptor.MyInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 *
 * @author MrZhao
 * @created 2025-10-11 12:27
 * @description
 *
 */
@Configuration
@SuppressWarnings("all")
public class WebConfig implements WebMvcConfigurer {


     @Autowired
      //private MyInterceptor myInterceptor;
     private LoginCheckInterceptor loginCheckInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(loginCheckInterceptor)
                .addPathPatterns("/**")
                // 登录接口不拦截，也就意味只要请求到达拦截器就一定不是登录请求
                .excludePathPatterns("/login");
    }
}